package com.tiancheng.trade.settlement.exception.error;

import com.tiancheng.trade.settlement.exception.assertion.BusinessExceptionAssert;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 业务错误码
 *
 * @author kellen
 * @date 2024/1/3
 */
@Getter
@AllArgsConstructor
public enum BusinessErrorInfoEnum implements BusinessExceptionAssert {

    SIGN_UTILS_KEY_FILE_ERROR(1013, "获取key失败，请检查地址"),
    SIGN_UTILS_KEY_NULL(1014, "获取key为空，请检查"),
    SIGN_UTILS_SIGN_ERROR(1015, "签名出错"),
    SETTLEMENT_RULE_ERROR(1016, "清分规则匹配失败"),
    ADD_REMARK_ERROR(1017, "新增差异原因失败，最多新增30条"),
    SETTLE_RULE_CLEARINGCYCLEVALUEEXT_NULL(1018, "清分周期拓展值不允许为空"),
    SETTLE_RULE_NOT_SUPPORT_CLEARING_RULE_NULL(1019, "不支持的清分规则"),
    SETTLE_RULE_RULE_PRE_RECEIVABLE_NOT_NULL(1020, "百分比清分，商户百分比和平台百分比不允许为空"),
    SETTLE_RULE_RULE_PRE_RECEIVABLE_ERROR(1021, "百分比清分，商户百分比和平台百分比异常，两项和为100"),
    SETTLE_RULE_RULE_FIX_PLATFORM_FIX_NOT_NULL(1022, "平台固定金额不允许为空，且金额需大于0"),
    SETTLE_RULE_RULE_FIX_MERCHANT_FIX_NOT_NULL(1027, "商户固定金额不允许为空，且金额需大于0"),
    SETTLE_RULE_RULE_PRODUCT_NOT_EXIT(1023, "商品不存在"),
    SETTLE_RULE_RULE_ORDER_SOURCE_NOT_SUPPORT(1024, "当前场景不开放导入清分规则能力"),
    SETTLE_RULE_RULE_MERCHANT_OR_PRODUCT_ERROR(1025, "商户或商品不存在！"),
    SETTLE_RULE_CLEARING_CYCLE_MODE_NOT_SUPPORT(1026, "不支持的清分清分周期类型！"),


    QUERY_ARGS_ERROR(2000, "查询条件错误"),
    DO_SETTLE_CHECK_ERROR(2001, "自动对账任务执行异常"),
    QUERY_NOT_EXIST_SETTLESUMMARY_ERROR(2002, "不存在对账记录"),

    MESSAGE_ARGS_ERROR(3000, "消息参数错误"),
    MESSAGE_NOT_EXIT_ORDER_ERROR(3001, "未查询到订单"),

    REVENUE_NOT_EXIST_MERCHANT(4000, "收入确认异常，未获取到商户"),
    REVENUE_NOT_EXIST_REVENUE_TYPE(4001, "收入确认异常，未知的收入确认类型"),
    REVENUE_DATE_TOO_LONG(4003, "日期不允许超过31天"),
    REVENUE_EXIST_SETTLE_LETTERS(4004, "已存在对账函，请删除或作废后再次生成"),
    REVENUE_SETTLE_LETTERS_EXIST_TASK(4005, "当前已存在生成对账函任务，请稍后再试！"),
    REVENUE_SETTLE_LETTERS_LOCK_ERROR(4006, "生成对账函异常，获取锁失败！"),
    REVENUE_SETTLE_LETTERS_NULL_RECORD(4007, "生成对账函异常，该条件下不存在收入明细！"),
    REVENUE_SETTLE_LETTERS_MAKE_FILE_ERROR(4008, "生成对账函异常，生成zip文件异常！"),
    REVENUE_SETTLE_LETTERS_NOT_FOUND_ERROR(4009, "未查询到对账函！"),

    LOCK_TIMEOUT_ERROR(9000, "获取锁超时！"),
    ;



    /**
     * 返回码
     */
    private int code;
    /**
     * 返回消息
     */
    private String message;
}
